package com.zf.shuashua.ui.popup;

import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.lxj.xpopup.core.CenterPopupView;
import com.zf.shuashua.R;
import com.zf.shuashua.api.Constants;
import com.zf.shuashua.api.Store;
import com.zf.shuashua.ui.gift.H5Activity;

/**
 * 提现失败
 */
public class BillFailPopup1 extends CenterPopupView {

    private TextView btnTitle, tvInfo, tvTips, tvKefu;
    private String message;
    private Activity context;

    public BillFailPopup1(@NonNull Activity context, String msg) {
        super(context);
        this.message = msg;
        this.context = context;
    }


    @Override
    protected int getImplLayoutId() {
        return R.layout.bill_popup_fail1;
    }

    @Override
    protected void onCreate() {
        super.onCreate();
        setupView();
    }

    private void setupView() {
        btnTitle = findViewById(R.id.btTitle);
        tvInfo = findViewById(R.id.tv_info);
        tvTips = findViewById(R.id.tvTips);
        tvKefu = findViewById(R.id.tvKefu);
        String str = message.substring(0, message.indexOf("TIPS"));
        tvInfo.setText(str);
        String str2 = message.substring(str.length() + 5);
        tvTips.setText(str2);
        btnTitle.setOnClickListener(v -> {
            dismiss();
        });
        tvKefu.setOnClickListener(view -> {
            dismiss();
            context.startActivity(new Intent(context, H5Activity.class).putExtra("money", Constants.H5_URL + "feedback").putExtra("title", "问题反馈"));
        });
    }

}

